# -*- coding: utf-8 -*-#
# ----------------------------------------*_*
# Author:       Chasetity
# Date:         2021/6/28
# ----------------------------------------*_*

import time
from selenium import webdriver
from selenium.webdriver import ActionChains


url = 'http://localhost/shopxo/'
# 实例化浏览器
cli = webdriver.Chrome()
#添加隐士等待
cli.implicitly_wait(5)
# 打开URL
cli.get(url=url)
# 浏览器最大化
cli.maximize_window()
# 点击登录按钮
cli.find_element('xpath','/html/body/div[2]/div/ul[1]/div/div/a[1]').click()

#创建鼠标对象
action = ActionChains(cli)

name = cli.find_element('xpath','/html/body/div[4]//form/div[1]/input').send_keys('admin')
cli.find_element('xpath','/html/body/div[4]/div/div[2]/div[2]/div/div/div[1]/form/div[2]/div/input').send_keys('123456')
button = cli.find_element('xpath','/html/body/div[4]//form/div[3]/button')
#鼠标双击事件
action.double_click(button).perform()
time.sleep(10)
cli.quit()






